<template>
  <div class="App" >
    <h2>App组件</h2>
    <p v-bgc>背景颜色</p>
    <p v-bgcX="'red'">背景颜色2</p>
    <Count />
  </div>
</template>

<script>
import Count from "@/components/Count"
export default {
  name: "App",
  data() {
    return {
    };
  },
  components:{
    Count
  },
  // 局部
  directives:{
    bgc(el){
      el.style.background="skyblue"
    },
    bgcX(el,binding){
      el.style.background=binding.value
    }
  }
};
</script>
